elif [ "$FOUND_AN_ENABLED_HIBERNATION_CHECK" -eq 0 ] ; then
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
fi
fi
else
$LM_VERBOSE && echo "Battery is not present." >> $OUTPUT
fi
done
else
ENOUGH_CHARGE=1
ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
$LM_VERBOSE && echo "Not on AC and could not check battery state -- data loss sensitive features stay enabled and auto-hibernation will not work." >> $OUTPUT
fi
if [ "$ENABLE_AUTO_HIBERNATION" -ne 0 -a "$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION" -eq 0 ] ; then
$LM_VERBOSE && echo "None of the batteries have a charge above the auto-hibernation level." >> $OUTPUT
# Don't continue -- if things are configured correctly, then we
# will be called on resume.
exit 0
fi
if [ "$ENOUGH_CHARGE" -eq 0 ] ; then
$LM_VERBOSE && echo "None of the batteries have a charge above the minimum level." >> $OUTPUT
$LM_VERBOSE && echo "Deactivating data loss sensitive features." >> $OUTPUT
ACTIVATE_WITH_POSSIBLE_DATA_LOSS=0
fi
fi
if [ "$INIT" -eq 0 ] ; then
echo -n "Laptop mode "
fi
WAS_ACTIVE=0
if [ "$ACTIVATE" -eq 1 ] ; then
echo -n "$STATE, active"
if [ "$ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -eq 0 ] ; then
echo -n " (Data-loss sensitive features disabled.)"
fi
echo
else
echo "$STATE, not active"
fi
# Finally, call laptop-mode-tools modules. The modules can use the settings
# from the config files, but they may NOT assume the settings actually exist,
# as no defaults have been given for them.
# Note that the /usr/local/lib path is deprecated.
export FORCE STATE ON_AC ACTIVATE ACTIVATE_WITH_POSSIBLE_DATA_LOSS KLEVEL KMINOR WAS_ACTIVE LM_VERBOSE
for SCRIPT in /usr/share/laptop-mode-tools/modules/* /usr/local/lib/laptop-mode-tools/modules/* /usr/local/share/laptop-mode-tools/modules/* /etc/laptop-mode/modules/*; do